package zelix.utils.resourceloader;

import zelix.Core;
import zelix.hack.Hack;
import zelix.utils.Utils;
import zelix.utils.system.WebUtils;
import zelix.value.BooleanValue;
import zelix.value.ModeValue;
import zelix.value.NumberValue;
import zelix.value.Value;

import java.io.*;

import static zelix.Core.NAME;

public class Strings {
    public static String Chinese_Hacks = null ;/*= "AimBot=自瞄\n" +
            "AntiAfk=防挂机\n" +
            "AntiBot=放假人\n" +
            "NoFall=无掉落伤害\n" +
            "AntiRain=无雨天\n" +
            "AntiWeb=无视蜘蛛网\n" +
            "ArmorHUD=装备显示\n" +
            "AttackPacketCIA=CIA包攻击\n" +
            "AttackPacketCW=CW包攻击\n" +
            "AutoArmor=自动装备\n" +
            "AutoEat=自动吃\n" +
            "AutoShield=自动防砍\n" +
            "AutoSoup=自动喝汤\n" +
            "AutoSprint=自动疾跑\n" +
            "AutoStep=自动台阶\n" +
            "AutoSwim=自动游泳\n" +
            "AutoTool=自动工具\n" +
            "AutoTotem=自动图腾\n" +
            "AutoWalk=自动行走\n" +
            "BedNuker=自动挖床\n" +
            "Blink=瞬移\n" +
            "BlinkAttack=瞬移攻击\n" +
            "BlockOverlay=方块边框\n" +
            "BowAimBot=弓自瞄\n" +
            "ChestESP=显示箱子\n" +
            "ChestStealer=箱子小偷\n" +
            "ClickGui=点击界面\n" +
            "CommandFrame=指令窗口\n" +
            "CommandGetter=指令获取器\n" +
            "Criticals=刀刀暴击\n" +
            "Disabler=关掉反作弊\n" +
            "Disconnect=自动退出\n" +
            "Enemys=敌人\n" +
            "EntityESP=显示生物\n" +
            "FakeCreative=假创造\n" +
            "AntiFall=防掉落虚空\n" +
            "FastBreak=快速挖掘\n" +
            "FastLadder=快速梯子\n" +
            "FireballReturn=自动弹火球\n" +
            "Flight=飞行\n" +
            "FreeCam=灵魂出窍\n" +
            "Ghost=鬼\n" +
            "GhostMode=关掉所有模块\n" +
            "Glide=滑行\n" +
            "Glowing=高亮显示\n" +
            "GuiWalk=背包行走\n" +
            "Cilp=高跳\n" +
            "HitBox=命中框\n" +
            "HUD=显示\n" +
            "InteractClick=互动点击\n" +
            "ItemESP=显示物品\n" +
            "KillAura=杀戮光环\n" +
            "LongJump=远跳\n" +
            "NightVision=夜视\n" +
            "NoSlow=无减速\n" +
            "NoSwing=无挥舞\n" +
            "Nuker=自动挖掘\n" +
            "PacketFilter=包过滤器\n" +
            "Parkour=跑酷\n" +
            "PickupFilter=过滤掉落物\n" +
            "PlayerRadar=玩家雷达\n" +
            "PluginsGetter=获取插件\n" +
            "PortalGodMode=传送门神\n" +
            "Profiler=详细显示\n" +
            "Rage=暴怒\n" +
            "Reach=距离\n" +
            "Scaffold=自动搭路\n" +
            "Search=矿物搜索\n" +
            "SelfDamage=自伤\n" +
            "SelfKick=自踢\n" +
            "SkinChanger=皮肤更换器\n" +
            "SkinStealer=皮肤小偷\n" +
            "Speed=速度\n" +
            "Spider=蜘蛛\n" +
            "Suicide=自杀\n" +
            "SuperKick=超级击退\n" +
            "Targets=目标\n" +
            "Teams=团队\n" +
            "Teleport=传送\n" +
            "TestHack=测试\n" +
            "Timer=变速齿轮\n" +
            "TpAura=百米大刀\n" +
            "Tracers=连线玩家\n" +
            "Trajectories=抛物线\n" +
            "Trigger=自动打人\n" +
            "Velocity=反击退\n" +
            "WallHack=隔墙绘制\n" +
            "XRay=矿透\n" +
            "SafeWalk=安全行走\n"+
            "AntiSneak=反潜行\n"+
            "IRCChat=聊天室\n"+
            "AutoClicker=自动点击\n"+
            "AutoMine=自动挖矿";
            */

    public static String Chinese_HackCategory =null;// "玩家类"+"="+"显示类"+"="+ "战斗类"+"="+ "其他类"+"="+"移动类";

    //public static String Chinese_Settings = "可视";
    public static String Chinese_ModeValuesMappings =null; //"Mode=模式\n"+"CPS=点击数";

    public static void main(String[] args) {
        loadTranslation();

    }
    public static void loadTranslation(){
        try {

            String Translations = "AimAssist=自瞄\n" +
                    "AntiHunger=反饥饿\n" +
                    "CloudConfig=云配置\n" +
                    "AntiAfk=防挂机\n" +
                    "AntiBot=防假人\n" +
                    "NoFall=无掉落伤害\n" +
                    "AntiRain=无雨天\n" +
                    "AntiWeb=无视蜘蛛网\n" +
                    "ArmorHUD=装备显示\n" +
                    "AttackPacketCIA=CIA包攻击\n" +
                    "AttackPacketCW=CW包攻击\n" +
                    "AutoArmor=自动装备\n" +
                    "AutoEat=自动吃\n" +
                    "AutoShield=自动防砍\n" +
                    "AutoSoup=自动喝汤\n" +
                    "AutoSprint=自动疾跑\n" +
                    "AutoStep=自动台阶\n" +
                    "AutoSwim=自动游泳\n" +
                    "AutoTool=自动工具\n" +
                    "AutoTotem=自动图腾\n" +
                    "AutoWalk=自动行走\n" +
                    "BedNuker=自动挖床\n" +
                    "Blink=瞬移\n" +
                    "BlinkAttack=瞬移攻击\n" +
                    "BlockOverlay=方块边框\n" +
                    "BowAimBot=弓自瞄\n" +
                    "ChestESP=显示箱子\n" +
                    "ChestStealer=箱子小偷\n" +
                    "ClickGui=点击界面\n" +
                    "CommandFrame=指令窗口\n" +
                    "CommandGetter=指令获取器\n" +
                    "Criticals=刀刀暴击\n" +
                    "Disabler=关掉反作弊\n" +
                    "Disconnect=自动退出\n" +
                    "Enemys=敌人\n" +
                    "EntityESP=显示生物\n" +
                    "FakeCreative=假创造\n" +
                    "AntiFall=防掉落虚空\n" +
                    "FastBreak=快速挖掘\n" +
                    "FastLadder=快速梯子\n" +
                    "FireballReturn=自动弹火球\n" +
                    "Flight=飞行\n" +
                    "FreeCam=灵魂出窍\n" +
                    "Ghost=鬼\n" +
                    "GhostMode=关掉所有模块\n" +
                    "Glide=滑行\n" +
                    "Glowing=高亮显示\n" +
                    "GuiWalk=背包行走\n" +
                    "Cilp=高跳\n" +
                    "HitBox=命中框\n" +
                    "HUD=显示\n" +
                    "InteractClick=互动点击\n" +
                    "ItemESP=显示物品\n" +
                    "KillAura=杀戮光环\n" +
                    "LongJump=远跳\n" +
                    "NightVision=夜视\n" +
                    "NoSlow=无减速\n" +
                    "NoSwing=无挥舞\n" +
                    "Nuker=自动挖掘\n" +
                    "PacketFilter=包过滤器\n" +
                    "Parkour=跑酷\n" +
                    "PickupFilter=过滤掉落物\n" +
                    "PlayerRadar=玩家雷达\n" +
                    "PluginsGetter=获取插件\n" +
                    "PortalGodMode=传送门神\n" +
                    "Profiler=详细显示\n" +
                    "Rage=转头\n" +
                    "Reach=距离\n" +
                    "Scaffold=自动搭路\n" +
                    "Search=矿物搜索\n" +
                    "SelfDamage=自伤\n" +
                    "SelfKick=自踢\n" +
                    "SkinChanger=皮肤更换器\n" +
                    "SkinStealer=皮肤小偷\n" +
                    "Speed=速度\n" +
                    "Spider=蜘蛛\n" +
                    "Suicide=自杀\n" +
                    "SuperKick=超级击退\n" +
                    "Targets=目标\n" +
                    "Teams=团队\n" +
                    "Teleport=传送\n" +
                    "TestHack=测试\n" +
                    "Timer=变速齿轮\n" +
                    "TpAura=百米大刀\n" +
                    "Tracers=连线玩家\n" +
                    "Trajectories=抛物线\n" +
                    "Trigger=自动打人\n" +
                    "Velocity=反击退\n" +
                    "WallHack=隔墙绘制\n" +
                    "XRay=矿透\n" +
                    "SafeWalk=安全行走\n" +
                    "AntiSneak=反潜行\n" +
                    "IRCChat=聊天室\n" +
                    "AutoClicker=自动点击\n" +
                    "FastBow=快速弓箭\n" +
                    "FastUse=快速使用\n" +
                    "FastPlace=自动点击\n" +
                    "ItemTeleport=物品传送\n" +
                    "EnemyInfo=敌人信息\n" +
                    "ServerCrasher=服务器崩溃器\n" +
                    "AntiItemLag=反物品卡顿\n" +
                    "SelfDestruct=自毁\n" +
                    "AttackSpeed=攻击速度\n" +
                    "HighJump=高跳\n" +
                    "AutoMine=自动挖矿@@@@@@@玩家类=显示类=战斗类=其他类=移动类=\n" +
                    "@@@@@@@Mode=模式\n" +
                    "CPS=点击数\n" +
                    "Reach=距离\n" +
                    "Min=最小\n" +
                    "Max=最大";
            String[] STR = Translations.split("@@@@@@@");

            Chinese_Hacks = STR[0];
            Chinese_HackCategory = STR[1];
            Chinese_ModeValuesMappings = STR[2];

            String[] translations = Chinese_Hacks.split("\n");
            String[] translationsValue = Chinese_ModeValuesMappings.split("\n");
            for (int i = 0; i < translations.length; i++) {
                String[] Mappings =translations[i].split("=");
                if(Core.hackManager.getHack(Mappings[0]) != null){
                    Core.hackManager.getHack(Mappings[0]).setChinese(Mappings[1]);
                }

            }
            /*
            for (int i = 0; i < translationsValue.length; i++) {
                for (Hack hack:Core.hackManager.getHacks()) {
                    for (Value value : hack.getValues()){
                        String[] var1 =translationsValue[i].split("=");
                        ////////System.out.println("value.getName() = " + value.getName());
                        if (var1.length == 2 && value instanceof ModeValue){
                            value.setCNName(value.getName().replaceAll(var1[0],var1[1]));
                            //      ////System.out.println(value.getName()+" : "+value.getRenderName());
                            continue;dewewdewdewdewdewdew
                        }

                        if (var1.length == 2 && value instanceof NumberValue){
                            value.setCNName(value.getName().replaceAll(var1[0],var1[1]));
                            //   ////System.out.println(value.getName()+" : "+value.getRenderName());
                            continue;
                        }
                        if (var1.length == 2 && value instanceof BooleanValue){
                            value.setCNName(value.getName().replaceAll(var1[0],var1[1]));
                            //      ////System.out.println(value.getName()+" : "+value.getRenderName());
                            continue;
                        }
                    }
                }
            }

             */
        } catch (Throwable e) {
            e.printStackTrace();
        }

      //  ////System.out.println(Chinese_Hacks);
      //  ////System.out.println(Chinese_HackCategory);

      //  ////System.out.println(Chinese_ModeValuesMappings);






    }

    public static String readToString(String fileName) {
        String encoding = "UTF-8";
        File file = new File(fileName);
        Long filelength = file.length();
        byte[] filecontent = new byte[filelength.intValue()];
        try {
            FileInputStream in = new FileInputStream(file);
            in.read(filecontent);
            in.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            return new String(filecontent, encoding);
        } catch (UnsupportedEncodingException e) {
            System.err.println("The OS does not support " + encoding);
            e.printStackTrace();
            return null;
        }
    }


}
